package com.sxkiler.demo.web.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.sxkiler.demo.web.dao.IUserDao;
import com.sxkiler.demo.web.service.IUserService;
import com.sxkiler.demo.web.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements IUserService {

    @Resource
    IUserDao userDao;

    @Override
    public UserVo findUserByNumber(String number) {
        Map paramMap = new HashMap();
        paramMap.put("number",number);
        List<UserVo> userList = userDao.getUserInfo(paramMap);
        return ObjectUtil.isNotEmpty(userList)?userList.get(0):null;
    }
}
